<template>
  <div id="app">
    <el-container>
      <el-header>
        <adminTop></adminTop>
      </el-header>
      <el-container>
        <el-aside  v-if="!currentPathFlag" width="220px" :style="asideStyle" style="background-color: #EBEEF1;overflow: hidden">
          <adminLeft></adminLeft>
        </el-aside>
        <el-main>
          <div class="content">
            <router-view></router-view>
          </div>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>
<script>

export default {
  data() {
    return {
      asideStyle: {
        width: "200px"
      },
      permission: ['menu','summaryIndex','index_yz','index_sgb','index_jjz','index_dcs','caseRiskIndex1','detail1'],
      now: new Date(),
      timer: null,
    }
  },
  computed: {
    currentPathFlag() {
      const currentPath = this.$route.path.replaceAll("/", "")
      return this.permission.includes(currentPath);
    },
    formattedDateTime() {
      const {now} = this;
      const year = now.getFullYear();
      const month = ('0' + (now.getMonth() + 1)).slice(-2);
      const day = ('0' + now.getDate()).slice(-2);
      const hours = ('0' + now.getHours()).slice(-2);
      const minutes = ('0' + now.getMinutes()).slice(-2);
      const seconds = ('0' + now.getSeconds()).slice(-2);

      return `${year}年${month}月${day}日 ${hours}时${minutes}分${seconds}秒`;
    }
  },
  mounted() {
    this.timer = setInterval(() => {
      this.now = new Date();
    }, 1000);
  },
  methods: {}
};
</script>
<style scoped>
.el-header {
  background: url("@/assets/top_back.png");
  height: 40px !important;
  width: 100%;
}

.el-container{
  height: calc(100vh - 40px);
}

.el-aside{
  background: white !important;
  border-right: 1px solid #ececec;
}

.router-link-active {
  text-decoration: none;
}

.el-main {
  margin: 0;
  padding: 0;
  overflow: hidden;
}



body,
html {
  width: 100%;
  height: auto;
  background-color: #0e1e3e;
}


#left-menu-list-box .el-menu {
  border-right: none;
  background-color: #ffffff;
}

a {
  text-decoration: none;
}


#app {
  margin: 0;
  padding: 0;
}
</style>